package com._5704.website.mapper;

import com._5704.website.entity.Project;
import com._5704.website.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Yiyoung
 * @since 2021-07-25
 */
@Mapper
public interface ProjectMapper extends BaseMapper<Project> {

    List<Project> getProjects(@Param("page") int page,@Param("num") int num);

    List<User> getMembers(Integer id);

    User getMember(@Param("userId") String userId, @Param("id") int id);

    void setMember(@Param("userId") String userId, @Param("id") int id);

    void cancelMember(@Param("userId") String userId, @Param("id") int id);

    int getNum();

    List<Project> getMyProject(@Param("userId")String userId,@Param("page") int page,@Param("num") int num);

    List<Project> getPartProject(@Param("userId")String userId,@Param("page") int page,@Param("num") int num);

    List<Project> getProjectByName(@Param("projectName")String projectName,@Param("page") int page,@Param("num") int num);

    int getMineNum(String userId);

    int getPartNum(String userId);

    int getNumSea(String isSearch);

    void updatePic(@Param("pic")String dataBaseFileName,@Param("id") Integer id);
}
